#include "drv_tmr.h"

void drv_tmr1_init(T_UWORD ruw_OverFlowTime){
    /*Clean T1CON Register*/
    T1CON = T1CON_CLEAR;
    /*Configure 16 bit or 8 bit mode*/
    //T1CON |= MOD_16;
    /*Configure Timer 1 Preescale*/
    T1CON |= PREESCALER(0);
    /*Configure Timer 1 Osc*/
    T1CON |= (OSC_DISABLE);
    /*Configure SYNC external input*/
    T1CON |= (NOT_SYNC);
    /*Configure Source Clock*/
    T1CON |= (TMR1_ON);

    TMR1 = 0xFFFF - ruw_OverFlowTime;
}